<template>
	<view style="padding: 5px">
		<uni-row>
			<uni-col>
				<uni-datetime-picker v-model="rq" type="date" :clear-icon="false" :end="Date.now()" @change="getRetentionStuByClassId"/>
			</uni-col>
		</uni-row>
		
		<uni-card v-for="(item,index) in retentionList" :key="index">
			<view>
				<text>班级：{{item.className}}</text>
				<text style="float: right;">滞留学生：{{item.studentName}}</text>
			</view>
		</uni-card>
	</view>
</template>

<script>
	import retention from '@/api/modules/retention.js'

	export default {
		onLoad(options) {
			this.rq = options.rq;
			this.classId = options.classId;
			this.getRetentionStuByClassId();
		},
		data() {
			return {
				retentionList:[],
				rq: '',
				classId : '',
			}
		},
		methods: {
			getRetentionStuByClassId() {
				retention.getRetentionStuByClassId(this.classId,this.rq).then( res => {
					console.log("滞留学生信息：",res.data);
					this.retentionList = res.data;
				})
			}
		}
	}
</script>


<style>
</style>
